package cn.connorma.example.oauth.github;

import java.io.Serializable;

/**
 * @author matian
 * @date 2023-02-13 16:28:48
 */
public class Result implements Serializable {
    private static final long serialVersionUID = -1234567890L;

    private int code;
    private String msg;
    private Object data;

    public static Result success() {
        Result result = new Result();
        result.code = 0;
        result.msg = "";
        result.data = null;
        return result;
    }

    public static Result error(int code) {
        Result result = new Result();
        result.code = code;
        result.msg = "";
        result.data = null;
        return result;
    }

    public Result msg(String msg) {
        this.msg = msg;
        return this;
    }

    public Result data(Object data) {
        this.data = data;
        return this;
    }

}
